package top.ckxgzxa.newscms.entity.dto;

import lombok.Data;
import top.ckxgzxa.newscms.validation.annotation.PasswordMatch;
import top.ckxgzxa.newscms.validation.annotation.ValidEmail;
import top.ckxgzxa.newscms.validation.annotation.ValidPassword;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author 赵希奥
 * @date 2022/5/25 10:05
 * @gitHub https://github.com/CKXGZXA
 * @gitee https://gitee.com/ckxgzxa
 * @description:
 */

@Data
@PasswordMatch
public class UserDto implements Serializable {
    @NotNull
    @NotBlank
    @Size(min = 4, max = 20, message = "用户名长度必须在4-20个字符之间")
    private String name;

    @ValidPassword
    private String password;

    private String matchPassword;

    @NotNull
    @ValidEmail
    private String email;
}
